#ifndef USERDETAILS_H
#define USERDETAILS_H

#include <QtGui>
#include <QContactManager>
#include <QContact>
#include <QPixmap>

class UserAvatar: public QObject
{
Q_OBJECT
public:
	UserAvatar(QObject * parent = 0): QObject( parent) { avatar = NULL; }

	QString name;
	QPixmap *avatar;
};



QTM_USE_NAMESPACE
class UserDetails: public QDialog
{
Q_OBJECT
public:
	UserDetails(QString &name, QString &number, QWidget *parent=0);
	~UserDetails();

	static QPixmap *getUserAvatar(QString &name);

signals:
	int callUser(const QString &name, const QString &number);
	int smsUser(const QString &name, const QString &number);

public slots:
	void callUserClicked();
	void smsUserClicked();

private:
	static QContact *getUserDetails(QString *name);
	static QList<UserAvatar *> m_avatars;

	QLabel *label;
	QLabel *pix;
	QPushButton *callButton;
	QPushButton *smsButton;
	QPushButton *closeButton;
	QFrame *thumb;

	QString *m_name;
	QString *m_number;
};

#endif // USERDETAILS_H
